In a Packet Switching Network (PSN), in addition to service data transferring and forwarding among devices, Operation, Administration, and Maintenance (OAM) also needs to be performed on the data, and a packet carrying an OAM message is called an OAM packet. The OAM packet and the data packet employ the same transfer channel and forwarding mechanism, and only the contents thereof are different in that the OAM packet carries certain administration information. The OAM packets are periodically transferred among devices based on certain protocols and standards, so as to realize exchange of the administration information. Therefore, the OAM packet can reflect working states of the data packet and a service channel. Functions such as network performance detection, fault detection and location, and trigger protection switching can be realized by using the information carried in the OAM packet, in which the network performance detection mainly includes tests on packet loss rate, delay, jitter, and throughput.
The packet loss rate is one of the major indexes for measuring the quality of a PSN physical or logical link, which can be understood as a ratio of a total number of lost data packets detected by a receiving end and the total number of the data packets transmitted by a transmitting end on a link at a particular network level in a certain period. The packet loss rate detection generally employs a mode of transmitting by a source end and checking by a destination end, that is, the source end records the number of the transmitted data packets, and the destination end checks whether the number of the practically received data packets is the same with the number of the data packets transmitted by the source end.
The packet loss rate detection technology in the prior art mainly employs the method in which the source end periodically writes a counting value of the transmitted data packets into an OAM packet, and the destination end counts and checks the received data packets. That is, the transmitting end counts the transmitted data packets, and periodically transmits the OAM packets while transmitting the data packets, in which the OAM packet carries the counting value of a data packet counter before the OAM packet is transmitted. As shown in FIG. 1, packet 101 are the data packets, and the transmitting end writes the counting value of the data packets transmitted before packet 102 into packet 102.
The receiving end receives the data packets and the OAM packets, also uses the counter to count the received data packets, parses the OAM packets to obtain the counting value, and performs subtraction between the counting values of two consecutive OAM packets such as packet 102 and 103, and the difference thereof is the number of the data packets transmitted by the source end in a measurement period. The difference in the counter for the data packets at the receiving end in the measurement period of the receiving end is the number of the data packets practically received by the destination end. The result calculated through (the number of data packets transmitted by the source end−the number of data packets practically received by the destination end)/the number of data packets transmitted by the source end is the packet loss rate.
Since priorities of the data packets vary in the PSN network technology, the packets with high priority are transmitted first, so it takes a certain period of time (though very short) for transmission and conversion of queues with different levels of priority, while in the queues with the same level of priority, it also takes a certain period of time (though very short) to write the counting value of a transmission counter at the source end into the OAM packet. Since the data packets are transmitted continuously, when the counting value of the transmitting end is written into the OAM packet, the data packets not counted might be transmitted and the data packets counted might be not transmitted, leading to a certain error between the counting value in the OAM packet and the number of the practically transmitted data packets, and in the end resulting in the incorrect calculation of the packet loss rate, thus failing to reflect the practical condition of the link.
The solution may be controlling the transmitting sequence of the packets. In this manner, before and after the OAM packet is inserted into a transmission queue, the data packets cannot be inserted. Alternatively, the counting value in the OAM packet should be written and inserted fast enough, which requires additional hardware support. In one aspect, the forwarding technology in the prior art needs to be modified, which leads to poor generality, high cost, and increased processing complexity; and in another aspect, performance indexes such as network delay are affected to a certain degree.